package com.gcs.k8s01.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gcs.k8s01.sensitive.Sensitive;
import com.gcs.k8s01.sensitive.SensitiveStrategy;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;

/**
 * @Description TODO
 * @Author guosong
 * @Date 2023/11/29 10:13
 */
@Data
@Entity
@Table(name = "employee_info")
@ApiModel
public class EmployeeInfo {

        @Id
        @GeneratedValue(strategy = GenerationType.AUTO, generator = "uuid")
        @GenericGenerator(name = "uuid", strategy = "uuid2")
        private String id;

        @Sensitive(strategy = SensitiveStrategy.CHINESE_NAME)
        private String name;

        @Sensitive(strategy = SensitiveStrategy.EMAIL)
        private String email;

        @Sensitive(strategy = SensitiveStrategy.ID_CARD)
        private String identity;

        @Sensitive(strategy = SensitiveStrategy.PASSWORD)
        private String password;

        @Sensitive(strategy = SensitiveStrategy.PHONE)
        private String phone;

        //@Sensitive(strategy = SensitiveStrategy.ADDRESS)
        private String address;

        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date birthday;

}
